
let index_fn = async (ctx,next)=>{
    ctx.render('hello.html')
}


let user_fn = async (ctx,next)=>{

    let {user,pwd} =ctx.request.body;

    if(user==='admin' && pwd==='123'){
        ctx.body='登录成功'
    }
    else {
        ctx.body = '登录失败'
    }
}

module.exports ={
    '/':['get',index_fn],
    '/api/user':['post',user_fn]
}